import UtilsTemplate from '../../../components/UtilsTemplate';
export default {
	extends:UtilsTemplate,
	data(){
		return {
			apis:[
				{
					name:'只执行一次的Action',
					info:'用于包裹vuex的Action, 使其只执行一次, 注意:调用时可以传参immediate为true标识立即执行',
					code:`
<script>
import {vuexActionOnce} from '@lexmis/baseui/src/util/common';

new Vuex.Store({
	state:{},
	getters:{},
	mutations:{},
	actions:{
		...vuexActionOnce({
			async ['GET_MENUS']({commit}){
				
			}
		}),
	},
});
</${'script'}>`,
					tabs:[
						{
							name:'vuexActionOnce(map) => ActionMap',
							args:[
								{name:'map',info:'原始的Action键值对',type:'ActionMap',def:''},
							]
						},{
							name:'ActionMap',
							args:[
								{name:'[key:string]',info:'Action',type:'function',def:''},
							]
						},
					]
				}
			],
		};
	},
};
